﻿using BarManager.Core.DomainModel;
using BarManager.Core.DomainService;
using BarManager.Core.Entity;
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Linq.Expressions;

namespace BarManager.Infrastructure.Data.Repository
{
    public class PromocionDetalleRepository : BaseRepository<PromocionDetalle>, IPromocionDetalleRepository
    {
        public PromocionDetalleRepository(IObjectContext context)
            : base(context)
        {            
        }        

        public override IEnumerable<PromocionDetalle> Find(Expression<Func<PromocionDetalle, bool>> condition)
        {
            return base.Context.Query<PromocionDetalle>()
                .Where(condition)                
                .Include(x=> x.Producto);
        }
    }
}
